<template>
  <vo-table ref="yuTable" :data="data.tableData"> </vo-table>
</template>

<script setup>
  import {ref, reactive, toRef, onBeforeMount, getCurrentInstance} from 'vue';
  let {proxy} = getCurrentInstance();
  const data = reactive({
    data: {},
    tableData: {data: [], cols: [],},
  });
  onBeforeMount(() => {
    showData();
  });
  const showData = () => {
    proxy.$api.data.querySysTableShow(data.data).then(res => {
      data.tableData.cols = res.header;
      data.tableData.cols.unshift({type: 'index',title:'序号'})
      data.tableData.data = res.data;
    });
  };
  const props = defineProps({
    data: {},
  });
  data.data = toRef(props, 'data');
</script>
<style lang="scss" scoped></style>
